package com.jimmy.gulei;

import java.util.List;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.Window;
import android.widget.TabHost;


public class MainActivity extends TabActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_main);
		TabHost host = this.getTabHost();

		Intent intent1 = new Intent("android.intent.action.First");
		host.addTab(host.newTabSpec("rec").setIndicator("recommended")
				.setContent(intent1));

		Intent intent2 = new Intent("android.intent.action.Second");
		host.addTab(host.newTabSpec("cat").setIndicator("category")
				.setContent(intent2));

		host.setCurrentTab(0);

		List<RecomandArticles> lists = new DataBaseHandler(this)
				.getAllArticles();
		Log.i("jimmy", "articles size:" + lists.size());
		for (int i = 0; i < lists.size(); i++) {
			Log.i("jimmy", "articles is:" + lists.get(i).title);
		}

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

}
